<template>
	<view>
		<web-view :src="url" :webview-styles="style"></web-view>
	</view>
</template>

<script setup>
	import {
		ref,
		onBeforeUnmount
	} from "vue";
	import {
		onLoad,
		onNavigationBarButtonTap
	} from "@dcloudio/uni-app";

	const url = ref();
	const style = {
		color: "#184795"
	}

	onNavigationBarButtonTap((e) => {
		if (e.index === 0) {
			uni.reLaunch({
				url: "/pages/index/index"
			})
		}
	})

	onLoad((e) => {
		url.value = decodeURIComponent(e.url);
	})

	// let webview;
	onBeforeUnmount(() => {
		if (plus.webview.currentWebview()) {
			plus.webview.close();
		}
	})
</script>

<style lang="scss"></style>
